home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / cedrexx.lha / cedrexx_scripts / Format.ced < prev    next >
Text File  |  1996-05-07  |  2KB  |  54 lines

  1. /*************************************************************\
  2. ** $VER: Format.ced 1.0                                      **
  3. ** By  : James Allen (AKA $LiNg$HoT)                         **
  4. ** Date: September 94                                        **
  5. ** Rel : May 96.                                             **
  6. ** Description :                                             **
  7. **                                                           **
  8. **     - Formats every paragraph in the current file.          **
  9. **   - Doesnt format if line has NEWLINE in 1st 10 chars.    **
  10. **   - Status line on menu bar, shows progress.              **
  11. **   - Press a key to abort at any time.                     **
  12. **   - IMPORTANT: Place spaces between or indent paragraphs. **
  13. **                Otherwise paragraphs will merge!           **
  14. **                                                           **
  15. \*************************************************************/
  16.  
  17. address 'rexx_ced'
  18.  
  19. OPTIONS RESULTS
  20.  
  21. CEDTOFRONT
  22.  
  23. STATUS NUMLINES
  24. NumberOfLines = RESULT + 1
  25.  
  26. STATUS LINENUMBER
  27. CurLine = RESULT + 1
  28.  
  29. do while( CurLine ~= NumberOfLines & left(linebuf,2) ~= '##')
  30.     STATUS LINEBUFFER
  31.     linebuf = RESULT
  32.     /* If NEWLINE found in first 10 characters, then dont format */
  33.     If POS('0a'x,left(RESULT,10)) = 0 then 
  34.         WITH FILL
  35.     Else
  36.         DOWN
  37.  
  38.     LASTKEY
  39.     /* Check for a keystroke (~= -1) which is not an key release (< 128) */
  40.     IF (RESULT ~= -1) & (WORD( RESULT, 1 ) < 128) THEN DO
  41.         CEDTOFRONT
  42.         OKAY1 "Format Aborted!"
  43.         EXIT
  44.     END
  45.  
  46.     STATUS LINENUMBER
  47.     CurLine = RESULT + 1
  48.     STATUS NUMLINES
  49.     NumberOfLines = RESULT + 1
  50.  
  51.     DM "LineNumber: "CurLine" NumLines:  "NumberOfLines
  52. End 
  53. DM ""
  54.